//未完成垫付任务模块
$.ajaxSetup({
	url:$CONFIG.baseUrl+"/api/order/getOrderListByType",
	type: 'get',
	beforeSend:function(x){
		x.setRequestHeader("Authorization", localStorage.getItem('token'));
	},
	error: function(error){
		console.log('error')
		console.log(this.url)
	}
});

function forfun(m,data){
	var n = '<div class="to-be-operated">\
                    <div>\
                        <img src="images/#0">\
                        <p style="font-size: 12px;">#1</p>\
                        <time style="font-size: 12px;">#2</time>\
                    </div>\
                    <div>\
                        <img src="http://tbk.tutew.com/#3">\
                        <div class="content-money">\
                            <p>佣金:<span>#4</span></p>\
                            <p>垫资#5元<span>#6</span></p>\
                        </div>';
    var nm = n+m;
	var t="";
	if (data.data) {
		for(var i=0;i<data.data.length;i++){
	    	t+=nm.replace("#0",function(){
				var x = ''
				switch (data.data[i].platformName){
					case '淘宝':
					  x="icon_taobao.png";
					  break;
					case '阿里巴巴':
					  x="icon_alibaba.png";
					  break;
					case '拼多多':
					  x="icon_pdd.png";
					  break;
					case '美丽说':
					  x="icon_mls.png";
					  break;
					case '京东':
					  x="icon_jd.png";
					  break;
					case '蘑菇街':
					  x="icon_mgj.png";
					  break;
				}
				return x
			})
	    	.replace("#1", data.data[i].orderNum == null ? '' : data.data[i].orderNum)
	    	.replace("#2",data.data[i].orderCt.substring(0,10))
	    	.replace("#3",data.data[i].goods1Pic)
	    	.replace("#4",data.data[i].customerReceive)
	    	.replace("#5",data.data[i].goods1RealPrice)
	    	.replace("#6",function(){
				if(data.data[i].hpType == 1)return "普通好评";
				if(data.data[i].hpType == 2)return "文字好评";
				if(data.data[i].hpType == 3)return "图片好评";
				if(data.data[i].hpType == 4)return "视频好评";
			})
	    	.replace("#7",data.data[i].orderId)
	    }
	}
	
	return t;
}

